Skip to content

fix(smithy-client): set $retryable and $response in ServiceException constructor#1879

Open
TrevorBurnham wants to merge 1 commit intosmithy-lang:mainfrom
TrevorBurnham:service-exception-retryable
Open

fix(smithy-client): set $retryable and $response in ServiceException constructor#1879
TrevorBurnham wants to merge 1 commit intosmithy-lang:mainfrom
TrevorBurnham:service-exception-retryable

Conversation

@TrevorBurnham
Copy link
Contributor

@TrevorBurnham TrevorBurnham commented Feb 21, 2026

Issue #, if available:

Fixes #1543

Description of changes:

The ServiceException constructor was not assigning $retryable or $response from the options parameter, even though both properties are declared on the class and defined in the ServiceExceptionOptions type (via SmithyException).

This meant that constructing a ServiceException (or subclass) with $retryable or $response in the options object would silently drop those values.

const error = new ServiceException({
  name: "TestError",
  $fault: "client",
  $metadata: {},
  $retryable: { throttling: true },
});

error.$retryable; // was: undefined, now: { throttling: true }

The fix adds the two missing assignments in the constructor alongside the existing ones for $fault and $metadata.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@TrevorBurnham TrevorBurnham requested a review from a team as a code owner February 21, 2026 01:19
@TrevorBurnham TrevorBurnham force-pushed the service-exception-retryable branch from d48fc88 to 664cc1a Compare February 21, 2026 03:42
@kuhe
Copy link
Contributor

kuhe commented Feb 24, 2026

we haven't established a need for this yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property $retryable not set from ServiceException constructor

2 participants